<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>工资计算</title>
</head>
<body>
    <script>
        var y=20;
        var t=0.05;
        function gu(y){
            if(y==1)return 10000;
            return gu(y-1)+gu(y-1)*t;
        }
        alert(parseInt( gu(y)))
        function rui(){
            var s=10000;
            var t=0.05;
            for(i=1;i<20;i++){
                s+=s*t;
            }
            alert(s);
        }
        rui()
        // function gu(){
        //     var a=11;
        //     alert (a);
        // }
        // gu();
    </script>
</body>
</html>